#ifndef __CLINUXDEVICE_H__
#define __CLINUXDEVICE_H__

#ifdef __COMPILE_LINUX__

#include "include/CTypes.h"
#include "CommonDevice.h"

#include <X11/Xlib.h>
#include <X11/Xutil.h>

		struct SKeyMap
		{
			SKeyMap() {}
			SKeyMap(s32 x11, s32 win32)
				: X11Key(x11), Win32Key(win32)
			{
			}

			KeySym X11Key;
			s32 Win32Key;

			bool operator<(const SKeyMap& o) const
			{
				return X11Key<o.X11Key;
			}
		};

class CLinuxDevice : public CCommonDevice
{
private:
	Display *dpy;
	Window win;
    XVisualInfo *vi;
    bool doubleBuffer;
    bool Close;
	std::vector<SKeyMap> KeyMap;
	wchar_t **text;

public:
	CLinuxDevice(StartDriverParams *DrvParams);
	~CLinuxDevice();

	virtual void CreateOpenGLDriver();

	virtual stringc GetCaption();
	virtual void SetCaption(stringc Title);
	virtual bool Update();
	virtual bool CreatePLEWindow();
	virtual bool ChoseCorrectVisual();
	virtual DeviceTypeENUM GetDeviceType()			{	return DT_WIN32;	}
};

#endif

#endif
